#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
struct plane
{
    ll t, d, l;
};
plane a[25];
ll n, vis[24];
bool dfs(ll dep, ll ti)
{
    if (dep > n)
        return true;
    for (ll i = 1; i <= n; i++)
    {
        if (vis[i] || a[i].t + a[i].d < ti)
            continue;

        vis[i] = 1;
        if (dfs(dep + 1, max(ti, a[i].t) + a[i].l))
        {
            vis[i] = 0;
            return true;
        }
        vis[i]=0;
    }

    return false;
}
void solve()
{
    cin >> n;
    for (ll i = 1; i <= n; i++)
    {
        cin >> a[i].t >> a[i].d >> a[i].l;
    }
    if (dfs(1, 0))
    {
        yes;
    }
    else
        no;
}
int main()
{
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
